package au.com.betaversion.repository;

import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;

import au.com.betaversion.domain.Photo;

public interface PhotoRepository extends MongoRepository<Photo, String> {
	
	@Query("{ 'registeredUser.$id' : ?0 }")
	Iterable<Photo> findByUsername(String username);
	
	@Query("{ 'aircraft.$id' : ?0 }")
	Iterable<Photo> findByAircraft(String mark);

}
